[train] Raise ValueError when checkpoint_upload_fn does not return a checkpoint#58863
Merged
justinvyu merged 3 commits intoray-project:masterfrom Nov 24, 2025
Merged
Conversation
Signed-off-by: Timothy Seah <tseah@anyscale.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable validation check to ensure that a user-provided checkpoint_upload_fn returns a checkpoint object. By raising a ValueError when the function returns a falsy value, it helps users fail fast and avoid subtle bugs like stalled training runs. The implementation is straightforward and effective. The accompanying unit test is well-written and correctly verifies the new behavior in a distributed setting. Overall, this is a great improvement for user experience and robustness.
justinvyu
reviewed
Nov 21, 2025
python/ray/train/v2/tests/test_async_checkpointing_validation.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Timothy Seah <tseah@anyscale.com>
python/ray/train/v2/tests/test_async_checkpointing_validation.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Timothy Seah <tseah@anyscale.com>
ykdojo
pushed a commit
to ykdojo/ray
that referenced
this pull request
Nov 27, 2025
…checkpoint (ray-project#58863) Fail fast if the users forgets to return a checkpoint in their `checkpoint_upload_fn`. This also causes unexpected issues like `get_all_reported_checkpoints` stalling indefinitely because the counter is misaligned, which I can also fix in a separate PR. --------- Signed-off-by: Timothy Seah <tseah@anyscale.com> Signed-off-by: YK <1811651+ykdojo@users.noreply.github.com>
SheldonTsen
pushed a commit
to SheldonTsen/ray
that referenced
this pull request
Dec 1, 2025
…checkpoint (ray-project#58863) Fail fast if the users forgets to return a checkpoint in their `checkpoint_upload_fn`. This also causes unexpected issues like `get_all_reported_checkpoints` stalling indefinitely because the counter is misaligned, which I can also fix in a separate PR. --------- Signed-off-by: Timothy Seah <tseah@anyscale.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fail fast if the users forgets to return a checkpoint in their
checkpoint_upload_fn. This also causes unexpected issues likeget_all_reported_checkpointsstalling indefinitely because the counter is misaligned, which I can also fix in a separate PR.Testing
Unit tests